//
//  EncodeToMP4.h
//  EncodeVideo
//
//  Created by 刘泽琛 on 14-3-22.
//  Copyright (c) 2014年 刘 泽琛. All rights reserved.
//

@protocol SendResultUrl <NSObject>

- (void)backResultDatainfo:(NSURL *)url;

@end

#import <SVProgressHUD.h>
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import <CoreMedia/CoreMedia.h>
#import <MediaPlayer/MediaPlayer.h>
#import <AssetsLibrary/AssetsLibrary.h>

/*
 *视频质量
 */
enum{
    low = UIImagePickerControllerQualityTypeLow,
    medium = UIImagePickerControllerQualityTypeMedium,
    high = UIImagePickerControllerQualityTypeHigh
}videoQualityType;

typedef void(^OpenVC)(UIImagePickerController *pickerController);

@interface EncodeToMP4 : NSObject <UIImagePickerControllerDelegate,UINavigationControllerDelegate> {
    NSURL *videoURL; //视频地址
    BOOL hasMp4; //是否已有视频
    
    UIAlertView *alert;
    NSDate *startDate;
    NSString *mp4Path;
}
@property (nonatomic) BOOL hasVideo;

/*
 *得到最终处理好的data和url
 */

@property (nonatomic, strong) NSData *resultData;
@property (nonatomic, strong) NSURL *resultUrl;

@property (nonatomic, weak) id <SendResultUrl>delegate;
@property (nonatomic) BOOL isSave;

/*
 *初始化摄像
 */
- (id)initWithPickVideo:(OpenVC)block;

/*
 *获取文件的大小
 */
- (NSInteger)getFileSize:(NSString*)path;

/*
 *开始转码
 */
- (void)start:(NSURL *)url hasVideo:(BOOL)hasVideo isSave:(BOOL)isSave;


@end
